const express = require('express');
const router = express.Router();
const recordController = require('../controllers/recordController');
const auth = require('../middlewares/auth');

// 运动记录相关路由
router.post('/sport', auth, recordController.addSportRecord);
router.get('/sport', auth, recordController.getSportRecords);

// 饮食记录相关路由
router.post('/diet', auth, recordController.addDietRecord);
router.get('/diet', auth, recordController.getDietRecords);
router.get('/nutrition/today', auth, recordController.getTodayNutrition);

// 体重记录相关路由
router.post('/weight', auth, recordController.addWeightRecord);
router.get('/weight', auth, recordController.getWeightRecords);

// 睡眠记录相关路由
router.post('/sleep', auth, recordController.addSleepRecord);
router.get('/sleep', auth, recordController.getSleepRecords);

// 获取今日所有记录
router.get('/today', auth, recordController.getTodayRecords);

module.exports = router; 